<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;

class Chapter extends BaseModel
{
    use HasFactory;

    //关联编程语言表
    public function programmingLanguage()
    {
        return $this->belongsTo(ProgrammingLanguage::class, 'programming_language_id');
    }

    //关联章节详情表
    public function chapterDetail()
    {
        return $this->hasMany(ChapterDetail::class,'id', 'chapter_detail_id');
    }
}
